<script setup name="oapagination">
import { defineProps, defineModel } from 'vue';


let props = defineProps({
    total: {
        type: Number,
        default: 0
    },
    pageSize: {
        type: Number,
        // 需要与后端保持一致
        default: 10
    }
})

// 用于v-model双向绑定
let page = defineModel({required:true})


</script>

<template>
    <!-- 前端点击page会触发监听事件，因此这里的current-page必须双向绑定 -->
    <el-pagination background layout="prev, pager, next" :total="props.total" :page-size="props.pageSize"
                        v-model:current-page="page" />
</template>


<style scoped>
.el-pagination {
    justify-content: center;
}
</style>